<!DOCTYPE html>
<html>
<head>
<title>游戏房间</title> <#include "/header.html">
</head>
<body>
	<div id="rrapp" v-cloak>
		<div v-show="showList">
			<div class="grid-btn">
				<div class="form-group col-sm-2" style="max-width: 200px">
					<input type="text" class="form-control" v-model="q.id" @keyup.enter="query" placeholder="房间ID">
				</div>
				<div class="form-group col-sm-2" style="max-width: 200px">
					<input type="text" class="form-control" v-model="q.roomName" @keyup.enter="query"
						placeholder="房间名">
				</div>
				<a class="btn btn-default" @click="query">查询</a>
				<#if shiro.hasPermission("biz:room:save")>
				<a class="btn btn-primary" @click="add">
					<i class="fa fa-plus"></i>&nbsp;新增
				</a>
				</#if> <#if shiro.hasPermission("biz:room:update")>
				<a class="btn btn-primary" @click="update">
					<i class="fa fa-pencil-square-o"></i>&nbsp;修改
				</a>
				<a class="btn btn-primary" @click="changeStatus(1)">
					<i class="fa fa-angle-up"></i>&nbsp;启用房间
				</a>
				<a class="btn btn-primary" @click="changeStatus(0)">
					<i class="fa fa-angle-down"></i>&nbsp;禁用房间
				</a>
				</#if>
			</div>
			<table id="jqGrid"></table>
			<div id="jqGridPager"></div>
		</div>

		<div v-show="!showList" class="panel panel-default">
			<div class="panel-heading">{{title}}</div>
			<form class="form-horizontal">
				<div class="form-group">
					<div class="col-sm-2 control-label">游戏大厅</div>
					<div class="col-sm-10">
						<select class="form-control" v-model="room.centerId">
							<option disabled value="">请选择</option>
							<option v-for="entity in centerList" :value="entity.id">{{entity.centerName}}</option>
						</select>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label">房间名</div>
					<div class="col-sm-10">
						<input type="text" class="form-control" v-model="room.roomName" placeholder="房间名" />
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label">人数限制</div>
					<div class="col-sm-10">
						<input type="number" class="form-control" v-model="room.personLimit" placeholder="人数限制"
							min="1" />
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label">在线人数</div>
					<div class="col-sm-10">
						<input type="number" class="form-control" v-model="room.personOnline" placeholder="在线人数"
							min="0" />
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label">最小金额</div>
					<div class="col-sm-10">
						<input type="number" class="form-control" v-model="room.minAmount" placeholder="最小金额"
							min="1" max="10000" />
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label">最大金额</div>
					<div class="col-sm-10">
						<input type="number" class="form-control" v-model="room.maxAmount" placeholder="最大金额"
							min="1" max="10000" />
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label">发包数量</div>
					<div class="col-sm-10">
						<input type="text" class="form-control" v-model="room.packetQty" placeholder="数量@赔率,数量@赔率" maxlength="64"/>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label">是否为VIP房间</div>
					<div class="col-sm-10">
						<select class="form-control" v-model="room.isVip">
							<option value="0">否</option>
							<option value="1">是</option>
						</select>
					</div>
				</div>
				<div class="form-group" v-if="room.isVip == 1">
					<div class="col-sm-2 control-label">房间密码</div>
					<div class="col-sm-10">
						<input type="text" class="form-control" v-model="room.vipRoomPwd" placeholder="VIP 房间密码为6位数字"
							@focus="genPwd" maxlength="6" />
					</div>
				</div>
				<div class="form-group" v-if="room.isVip == 1">
					<div class="col-sm-2 control-label">房间管理员</div>
					<div class="col-sm-10">
						<input type="number" class="form-control" v-model="room.vipMemberId" placeholder="请填写会员ID" />
					</div>
				</div>
				<div class="form-group" v-if="room.isVip == 1">
					<div class="col-sm-2 control-label">房间过期时间</div>
					<div class="col-sm-10">
						<input type="date" class="form-control" v-model="room.vipExpireTime" />
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label">启用机器人</div>
					<div class="col-sm-10">
						<select class="form-control" v-model="room.enableRobot">
							<option value="1">启用</option>
							<option value="0">禁用</option>
						</select>
					</div>
				</div>
				<div class="form-group" v-if="room.enableRobot == 1">
					<div class="col-sm-2 control-label">发包频率(ms)</div>
					<div class="col-sm-10">
						<input type="number" class="form-control" v-model="room.robotSendRate" placeholder="发包频率(ms)"
							min="1000" />
					</div>
				</div>
				<div class="form-group" v-if="room.enableRobot == 1">
					<div class="col-sm-2 control-label">抢包频率(ms)</div>
					<div class="col-sm-10">
						<input type="number" class="form-control" v-model="room.robotGrabRate" placeholder="抢包频率(ms)"
							min="1000" />
					</div>
				</div>
				<div class="form-group" v-if="room.enableRobot == 1">
					<div class="col-sm-2 control-label">机器人中雷概率(0-100)</div>
					<div class="col-sm-10">
						<input type="number" class="form-control" v-model="room.robotLandmineRate"
							placeholder="中雷概率在0-100之间" min="0" max="100" />
					</div>
				</div>
				<div class="form-group" v-if="room.enableRobot == 1">
					<div class="col-sm-2 control-label">普通会员中雷概率(0-100)</div>
					<div class="col-sm-10">
						<input type="number" class="form-control" v-model="room.memberLandmineRate"
							placeholder="中雷概率在0-100之间" min="0" max="100" />
					</div>
				</div>
				<div class="form-group" v-if="room.enableRobot == 1">
					<div class="col-sm-2 control-label">机器人数</div>
					<div class="col-sm-10">
						<input type="number" class="form-control" v-model="room.robotQty" placeholder="机器人数量" />
					</div>
				</div>
				<div class="form-group" v-if="room.enableRobot == 1">
					<div class="col-sm-2 control-label">最大盈利</div>
					<div class="col-sm-10">
						<input type="number" class="form-control" placeholder="正数代表最大盈利，负数代表最大亏损" v-model="room.profitLimit" />
					</div>
				</div>
				<div class="form-group" v-if="room.enableRobot == 1">
					<div class="col-sm-2 control-label">最大亏损</div>
					<div class="col-sm-10">
						<input type="number" class="form-control" placeholder="正数代表最小盈利，负数代表最大亏损，" v-model="room.lossLimit" />
					</div>
				</div>
				<div class="form-group" v-if="room.enableRobot == 1">
					<div class="col-sm-2 control-label">时间点</div>
					<div class="col-sm-10">
						<input type="text" class="form-control" placeholder="时间格式: 2018-01-30 09:00:00" v-model="room.pointTime"/>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label">房间状态</div>
					<div class="col-sm-10">
						<select class="form-control" v-model="room.status">
							<option value="1">启用</option>
							<option value="0">禁用</option>
						</select>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label"></div>
					<input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定" />
					&nbsp;&nbsp;
					<input type="button" class="btn btn-warning" @click="reload" value="返回" />
				</div>
			</form>
		</div>
	</div>

	<script src="${request.contextPath}/statics/js/modules/biz/room.js?_${.now?long}"></script>
</body>
</html>